package com.oocl.euc.serviceTest;

import static org.junit.Assert.*;

import java.util.List;

import org.bson.types.ObjectId;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.oocl.euc.entity.Dish;
import com.oocl.euc.service.DishService;

public class DishServiceImplTest {
	private static ApplicationContext ac;
	private static DishService ds;
	@BeforeClass
	public static void init(){
		ac = new ClassPathXmlApplicationContext("applicationContext.xml");
		ds=(DishService)ac.getBean("dishService");
	}
	@Test
	public void testAddDish() {
		Dish d=new Dish();
		d.setDname("newDish4");
		d.setPrice(6.4);
		ds.addDish(d,"57ff4135b8828c234cd727bb");
	}

//	@Test
//	public void testDeleteDish() {
//		ds.deleteDish(15);
//	}
//
//	@Test
//	public void testFindDishesByMid() {
//		List<Dish> dishes = ds.findDishesByMid(71); 
//			System.out.println(dishes.get(dishes.size()-1).getDname()); 
//	}
//
//	@Test
//	public void testFindDishByDid() {
//		System.out.println(ds.findDishByDid(14).getMerchant().getAccount());
//	}
//
//	@Test
//	public void testUpdateDish() {
//		Dish dish=new Dish();
//		dish.setDname("updateDish0");
//		dish.setPrice(21.11);
//		ds.updateDish(dish);
//		
//	}

}
